import axios from 'axios';

axios.defaults.baseURL = 'https://wx.ailabcare.com/clinicalmall-web';
axios.defaults.headers.common['Authorization'] = sessionStorage.getItem("token");

export const qs = require('qs');
//字典项
export const dicType = param => {return  axios.post('common/dictDataList',param).then(res => res.data)};


//********医院管理 start ******
//根据医院id获取医生列表
export const getDoctorByHospital = param => {return axios.post("hospital/selectHospitalDoc",param).then(res => res.data)};
//为医院科室添加医生
export const addDoctor = param => {return axios.post("hospital/allotDoctorToBusHospital",param).then(res => res.data)};
//删除医生
export const delDoctor = param => {return axios.post("hospital/deleteUserHospital",param).then(res => res.data)};
//根据医院和科室获取医生
export const getDoctor = param =>{return axios.post("hospital/selectDoctorBySubject",param).then(res => res.data)};
//获取所有销售人员信息
export const getAllSale = () =>{return axios.post("hospital/getAllSale").then(res => res.data)};
//保存已分配销售人员
export const saveSale = param => {return axios.post("hospital/addSaleDoctor",param).then(res => res.data)};
//获取所有销售对应的医生信息
export const getSaleByHospital = param => {return axios.post("hospital/selectSaleDoctor",param).then(res => res.data)};
//*******医院管理 end ******

// ****** 服务点管理 start ******
//查询所有产品类型信息 product/selectAllProductType
export const getAllProductType = () => {return axios.post('product/selectAllProductType').then(res => res.data)};
//根据类型id获取所有的产品信息 product/getProductList 参数 prdTypeId
export const getProductList = param => {return axios.post('product/getProductList',param).then(res =>res.data)};
//serverList服务点列表
export const serverList = param =>{return axios.post('product/serverList',param).then(res => res.data)};
//根据服务点获取产品列表
export const getProductByServerId = param => {return axios.post('product/getProductByServerId',param).then(res=>res.data)};
//获取服务点列表
export const getRegionList = () => {return axios.post('product/getRegionList').then(res=>res.data)};
//获取产品列表
export const getProduct = () => {return axios.post('product/getProductList').then(res=>res.data)};
//添加服务点
export const addServer = param => {return axios.post('product/addServer',param).then(res => res.data)};
//修改服务点
export const updateServer = param => {return axios.post('product/updateServer',param).then(res => res.data)};
//添加服务点产品
export const addServerProduct = param => {return axios.post('product/addServerProduct',param).then(res => res.data)};
//修改服务点产品
export const updateServerProduct = param => {return axios.post('product/updateServerProduct',param).then(res => res.data)};
//****** 服务点管理 end ******
